package net.xilou.weibo;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by yong on 2016/3/23.
 */
public class DateTimeHelper {

    public static long time() {
        Date d = new Date();
        return d.getTime() / 1000;
    }

    public static String date(String format) {
        Date d = new Date();
        SimpleDateFormat ft = new SimpleDateFormat(format);
        return ft.format(d);
    }

    public static void main (String[] args) throws Exception {
        System.out.println(DateTimeHelper.date("y-M-d H:m:s"));
    }
}
